//
//  CustonTextField.swift
//  globalcarbusiness
//
//  Created by dongzhenyu on 2017/8/14.
//  Copyright © 2017年 dongzhenyu. All rights reserved.
//

import UIKit

class CustonTextField: UITextField {

    override init(frame: CGRect) {
        super.init(frame: frame)
        leftViewMode = UITextFieldViewMode.always
        layer.borderWidth = 0.5
        layer.borderColor = UIColor (red: 0.8667, green: 0.8667, blue: 0.8667, alpha: 1.0 ).cgColor
        font = UIFont.systemFont(ofSize: 12)
        backgroundColor = UIColor.white
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func textRect(forBounds bounds: CGRect) -> CGRect {
        let rect = CGRect(x: bounds.origin.x + 40, y: bounds.origin.y, width: bounds.width, height: bounds.height)
        return rect
    }
    
    override func leftViewRect(forBounds bounds: CGRect) -> CGRect {
        let rect = CGRect(x: bounds.origin.x + 20, y: 16, width: 20, height: 12)
        return rect
    }
    
}
